<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>作业3</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h1>haha</h1>
        <h1 v-for="(v,index) in items" :key="index">{{v}}</h1>
        <button v-for="v in btnitems">haha,我是新增的按钮</button>
        <hr>
        <button @click.once="items.push('haha,我是新增的一行')">点我新增一行</button>
        <button @click="btnitems++">点我新增一个按钮</button>
    </div>
    <script>
        const app = new Vue({
            el: "#root",
            data: {
                items:[],
                btnitems:0
            }
        }) 
    </script>
</body>
</html>